﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="x-ua-compatible" content="ie=7" />
<title>花间语</title>
<link href="/static/index/css/css_whir.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" href="/static/index/font/iconfont.css">
<link href="/static/index/css/user.css" rel="stylesheet" type="text/css" />
<link href="/static/index/css/toastr.min.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="/static/index/js/jquery.min.js"></script>
<script type="text/javascript"  src="/static/index/js/nav.js"></script>
<script type="text/javascript" src="/static/index/js/jquery.SuperSlide.2.1.1.js"></script>
<script type="text/javascript" src="/static/index/js/jquery-1.8.3.min.js"></script>
<script type="text/javascript" src="/static/index/js/bootstrap.min.js"></script>
<script type="text/javascript" src="/static/index/js/toastr.min.js"></script>
<style>

h4{
    margin-left: 20px;
}
p{
    text-align: center;
}
.btn1{
    width: 100px;
    height: 35px;
    border-radius: 5px;
    font-size: 16px;
    color: white;
    float:left;
    margin:20px 0;
    background-color: #8cd900;
}
.btn1:hover, .btn1:focus{
    background-color: #8cd900;
}
.modal{
    display: none;
    width: 100%;
    height: 100%;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 1000;
    background-color: rgba(0,0,0,0.5);
}
.modal-content{
    display: flex;
    flex-flow: column nowrap;
    justify-content: space-between;
    width: 50%;
    max-width: 700px;
    height: 40%;
    max-height: 500px;
    margin: 100px auto;
    border-radius:10px;
    background-color:#fff;
    -webkit-animation: zoom 0.6s;
    animation: zoom 0.6s;
    resize: both;
    overflow: auto;
}
@-webkit-keyframes zoom{
    from {-webkit-transform: scale(0)}
    to {-webkit-transform: scale(1)}
}
@keyframes zoom{
    from {transform: scale(0)}
    to {transform: scale(1)}
}
.modal-header{
    box-sizing:border-box;
    border-bottom:1px solid #ccc;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.close{
    color: #8cd900;
    font-size: 30px;
    font-weight: bold;
    margin-right: 20px;
    transition: all 0.3s;
}
.close:hover, .close:focus{
    color: #8cd900;
    text-decoration: none;
    cursor: pointer;
}
.modal-body{
    padding: 10px;
    font-size: 16px;
    box-sizing:border-box;
}
.modal-footer{
    box-sizing:border-box;
    border-top:1px solid #ccc;
    display: flex;
    padding: 15px;
    justify-content: flex-end;
    align-items: center;
}
.modal-footer button{
    width: 60px;
    height: 35px;
    padding: 5px;
    box-sizing: border-box;
    margin-right: 10px;
    font-size: 16px;
    color: white;
    border-radius: 5px;
    background-color: #8cd900;
}

.modal-footer input{
    width: 60px;
    height: 35px;
    padding: 5px;
    box-sizing: border-box;
    margin-right: 10px;
    font-size: 16px;
    color: white;
    border-radius: 5px;
    background-color: #8cd900;
}
.modal-footer button:hover, .modal-footer button:focus{
    background-color: #8cd900;
    border:none;
    cursor: pointer;
}

#cancel{width: 60px;
    height: 35px;
    padding: 5px;
    box-sizing: border-box;
    margin-right: 10px;
    font-size: 16px;
    text-align: center;
    color: white;
    border:2px solid #ccc;
    border-radius: 5px;
    background-color: #8cd900;}

#cancel:hover{
    cursor: pointer;}

@media only screen and (max-width: 700px){
    .modal-content {
        width: 80%;
    }
}

.namefile{width: 250px;height: 30px;border-radius:4px;border:1px solid #ccc;}

.catefile{width: 250px;height: 30px;border-radius:4px;border:1px solid #ccc;}


.img-detail{height: 30px;}
.pic1:hover .img-detail{
  display:block;
}
</style>
</head>
<body>
<!--头部-->
<div id="header">
  <div class="top_bg">
    <div class="logo"><a href="#"><img src="/static/index/imgs/logo.jpg" width="150" height="90" /></a></div>
    <div class="top">
      <!--导航-->
      <!-- {block name="header"} -->
      <div class="guide">
        <div class="welcom">Welcome to fantasy_dream !　</div>
        <div class="login">

            {empty name="session.hmy_user"}
            <a href="{:url('index/Login/index')}">登录</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <a href="{:url('index/Register/index')}">注册</a>
            {else /}

            {empty name="session.hmy_user.name"}

            <a href="{:url('index/User/index')}" title="进入{$session.hmy_user.tel}主页"> | 您好,{$Request.session.hmy_user.tel}</a>

            {else /}

            <a href="{:url('index/User/index')}" title="进入{$session.hmy_user.name}主页"> 您好,{$Request.session.hmy_user.name}</a>

            {/empty}

             &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="{:url('index/Login/outlogin')}">注销</a>

             {/empty}
        </div>
        <!-- <div class="shopcart">购物车（<a href="会员中心.html">0</a>）</div> -->
        <div class="searchbox">
          <form action="{:url('index/Index/online')}">
            <input type="text" value="" name="name" class="input" placeholder="请输入分类名"/>
            <input type="image" src="/static/index/imgs/sbtn.jpg"  class="btn"/>
          </form>
        </div>
      </div>
      <!-- {/block} -->
      <!--菜单导航-->
      <div class="nav">
        <ul id="navul" class="cl">
          <li><a href="{:url('index/index/index')}">首页</a></li>
          {volist name="category" id="v"}
          <li class="navmenu"><a href="{:url('index/Index/lists',['id'=>$v['id']])}">{$v['name']}</a>
          </li>
          {/volist}
        </ul>
    <script type="text/javascript">

             $(document).ready(function(){
            //  $('.hyinfo li ').hover(function(){$(this).find('.subbox').stop(true,true).slideToggle(); });
              $('.navmenu').mouseenter(function(){

            $(this).find('.subnav').css("display","block");//you can give it a speed

              });
              $('.navmenu').mouseleave(function(){
            $(this).find('.subnav').css("display","none");

              //jQuery(this).css("background-image", "none");

              });

            });

        </script>
      </div>
    </div>
  </div>
</div>

{block name="main"}
<!--中间内容-->
<div class="hymain">
  <div class="position">您当前的位置：<em>会员中心</em></div>
  <!--左侧菜单-->
  <div class="leftmenu">
    <div class="titlei"><h1>会员管理中心</h1></div>
    <div class="menubox">
      <h2>内容管理</h2>
        <h3><a href="{:url('index/Fansfollow/fanslist')}">粉丝管理</a></h3>
        <!-- <h3><a href="{:url('index/User/comment')}">评论管理</a></h3> -->
        <h3><a href="{:url('index/Like/index')}">收藏管理</a></h3>
        <h3><a href="{:url('index/Fansfollow/index')}">关注管理</a></h3>
      <h2>服务中心</h2>
        <h3><a href="#">站内信</a></h3>
      <h2>个人资料</h2>
        <h3><a href="{:url('index/User/edit')}">修改资料</a></h3>
        <h3><a href="{:url('index/User/pass')}">修改密码</a></h3>
        <!-- <h3><a href="javesript:void(0)" id="showModel1">修改密码</a></h3> -->
    </div>
  </div>
  <!--右侧内容-->
  <div class="rightinfo">
    <!--优惠券-->
    <div class="yhquan">
      <div class="tuxiang">
      <!-- <?php var_dump($session);?> -->
          {empty name="$session.hmy_user['icon']" id="v"}

          <img src="/static/index/imgs/vip.jpg"/>
          <span>
              <a href="#">修改图像</a>
          </span>
          {else /}
          <img src="http://pn5tyoo5a.bkt.clouddn.com/{$session.hmy_user.icon}"  width="100" height="100"/>
          <span>
              <a href="#">修改图像</a>
          </span>
          {/empty}
      </div>
      <div class="yhqlist">
      <div class="name">{$Request.session.hmy_user.name}</div>
      <table cellpadding="0" cellspacing="0" class="tab">
          <td width="20%" height="100%">关注<a href="{:url('index/Fansfollow/index')}">({$follow_num})</a></td>
          <td width="20%" height="100%">粉丝<a href="{:url('index/Fansfollow/fanslist')}">({$fans_num})</a></td>
          <td width="20%" height="100%">收藏<a href="{:url('index/Like/index')}">({$like_num})</a></td><!--
          <td width="20%" height="100%">评论：<a href="{:url('index/User/comment')}">({$comment_num})</a></td> -->
          <td width="30%" height="100%">统计：<a href="#">(0)</a></td>
      </table>
      </div>
    </div>




<!-- {block name="right"} -->
<!--推荐产品-->

<button class="btn1" id="showModel">上传文件</button>
<div id="modal" class="modal">
  <div class="modal-content" style="height:400px">
    <header class="modal-header">
      <h4>上传文件</h4>
      <span class="close">×</span>
    </header>
    <div class="modal-body">
       <form action="{:url('index/Picture/upload')}" enctype="multipart/form-data" method="post" id="Hmy_upload">
     <!-- <form enctype="multipart/form-data" method="post" id="Hmy_upload"> -->
        <table>
            <tr>
              <td>上传文件</td>
              <td><input type="file" name="file" class="file" id="files" multiple="true"/></td>
            </tr>
            <tr height="10"></tr>
            <tr>
              <td>文件分类</td>
              <td>
                <select name="cid" id="" class="catefile">
                  {volist name="res" id="v"}
                  <option value="{$v['id']}">{$v['name']}</option>
                  {/volist}
                </select>
              </td>
            </tr>
            <tr height="10"></tr>
            <tr>
            <td>文件名</td>
              <td><input type="text" name="name" class="namefile"/></td>
            </tr>
            <tr height="10"></tr>
            <tr>
            <td>文件简述:</td>
              <td><textarea name="abstruct" id="" cols="70" rows="10"></textarea></td>
            </tr>

        </table>
    </div>
      <footer class="modal-footer">
        <div id="cancel">取消</div>
        <button id="cancel">提交</button>
        <!-- <div id="cancel" onclick="detiles()">提交</div> -->
      </footer>
      </form>
  </div>
</div>


<script>

// 上传文件
    var btn = document.getElementById('showModel');
    var close = document.getElementsByClassName('close')[0];
    var cancel = document.getElementById('cancel');
    var modal = document.getElementById('modal');

    btn.addEventListener('click', function(){
        modal.style.display = "block";
    });

    close.addEventListener('click', function(){
        modal.style.display = "none";
    });

    cancel.addEventListener('click', function(){
        modal.style.display = "none";
    });


    // 上传图片

            function detiles(){
              // var data = $('#Hmy_upload').serialize();

              var file = document.getElementById("files");
              // var file = $('#files');
              // console.log(data);
              // console.log(fileObj);

              // var that = this;
              // var files = file.files[0];
              var form = new FormData(file);
              console.log(form);
              // form.append('file',files);

                $.ajax({
                    url:"/Hmy_upload",
                    Type:'post',
                    cententType:false,
                                processData:false,
                                dataType:'json',
                    data:form,
                    // data:"{\"file\":\"" + form + "\",\"data\":\"" + data + "\"}",
                    success:function(data){
                      // window.location.reload();

                      if (data.status) {
                          toastr.success(data.msg);
                          window.location.reload();
                      } else {
                          toastr.error(data.msg);
                      }

                    },
                    error:function(data){

                        toastr.error('系统故障,请联系管理员');

                    }
                });


            }



    function hmy_edit(){
              var data = $('#hmy_edit').serialize();
              console.log(data);

                $.ajax({
                    url:"/Hmy_doedit",
                    Type:'get',
                    data:data,
                    dataType:'json',
                    success:function(data){
                      // window.location.reload();

                      if (data.status) {
                          // modal1.style.display = "none";
                          toastr.success(data.msg);
                          window.location.reload();
                      } else {
                          toastr.error(data.msg);
                      }

                    },
                    error:function(data){

                        toastr.error('系统故障,请联系管理员');

                    }
                });


            }





    function telEmail(){

      // console.log(111);
        var email = document.getElementById('telemail').value;
        var etab = document.getElementById('etab');

        if (/^[\w\.-]+@\w+(\.\w+){1,3}$/i.test(email)) {
            // email.setAttribute("name","email");
            etab.innerHTML = '* 邮箱通过验证';
            etab.style.color = '#0a0';
            return true;
        } else {
            if (/^[1]{1}[0-9]{10}/.test(email)) {
                etab.innerHTML = '* 手机号码通过验证';
                etab.style.color = '#0a0';

                return true;
            }else{

                etab.innerHTML = '* 手机/邮箱格式不正确!';
                etab.style.color = '#f00';
                return false;
            }
        }
    }

    function checkUser(){

        var user = document.getElementById('user_reg').value;
        var utab = document.getElementById('utab');

        if (user == null){

              utab.innerHTML = '* 用户名不能为空!';
              utab.style.color = '#f00';
              return false;

          }else{

              utab.innerHTML = '* 通过验证';
              utab.style.color = '#0a0';
              return true;

        }
    }

    function checkPass(){

        var pass = document.getElementById('pass').value;
        var ptab = document.getElementById('ptab');

        if (pass == null){

              rptab.innerHTML = '* 密码不能为空!';
              rptab.style.color = '#f00';
              return false;

        }else{

          if (pass.length < 6 || pass.length > 12) {
              ptab.innerHTML = '* 密码长度不合法!';
              ptab.style.color = '#f00';
              return false;

          } else {

              ptab.innerHTML = '* 通过验证';
              ptab.style.color = '#0a0';
              return true;

          }

        }
    }

    function checkRepass(){

        var pass = document.getElementById('pass').value;
        var repass = document.getElementById('repass').value;
        var rptab = document.getElementById('rptab');

        if (repass == null){

              rptab.innerHTML = '* 密码不能为空!';
              rptab.style.color = '#f00';
              return false;

        }else{

          if (pass == repass){
              rptab.innerHTML = '* 通过验证';
              rptab.style.color = '#0a0';
              return true;
          } else {
              rptab.innerHTML = '* 两次密码不一致!';
              rptab.style.color = '#f00';
              return false;
          }

        }
    }

    // 表单提交验证
    // function hmy_register() {
    //     return checkEmail() && checkUser() && checkPass() && checkRepass();
    // }

</script>


<!--推荐产品-->
    <div class="titlei2" style="margin-top: 80px;"><h1>我的作品<font color="green">({$list_num})</font></h1><h3 style="float:right;"><a href="{:url('index/Picture/Index')}">查看全部 >></a>
    </h3></div>
    <div class="picnews" style="margin-bottom: 100px">
      <div class="picScroll-left">
              <div class="bd">
                <ul class="picList">
                  {empty name="list"}

                      <font align="center" size="4">这家伙很懒,他还没有作品....</font>

                    {else/}

                      {volist name="list" id="v"}

                      <li>
                        <div class="pic">
                          <a href="{:url('index/Picture/detail',['id'=>$v['id']])}"><img class="pic1" src="http://pn5tyoo5a.bkt.clouddn.com/{$v.src}" title="{$v.title}"/></a>
                        </div>

                      </li>
                      {/volist}

                  {/empty}

                </ul>
              </div>

     </div>
  </div>
<!--底部-->


<script type="text/javascript">
$(document).ready(function(){

  $("#leftsead a").hover(function(){
    if($(this).prop("className")=="youhui"){
      $(this).children("img.hides").show();
    }else{
      $(this).children("img.hides").show();
      $(this).children("img.shows").hide();
      $(this).children("img.hides").animate({marginLeft:'0px'},'slow');
    }
  },function(){
    if($(this).prop("className")=="youhui"){
      $(this).children("img.hides").hide('slow');
    }else{
      $(this).children("img.hides").animate({marginLeft:'-143px'},'slow',function(){$(this).hide();$(this).next("img.shows").show();});
    }
  });

  $("#top_btn").click(function(){if(scroll=="off") return;$("html,body").animate({scrollTop: 0}, 600);});

});
</script>


</body>
</html>
